from django.db import models

# Create your models here.

class Staff(models.Model):
    staff_id = models.IntegerField(primary_key=True)
    staff_name = models.CharField(max_length=30)
    staff_sex = models.CharField(max_length=2)
    staff_phonenum = models.CharField(max_length=11)
    staff_email = models.EmailField()
    staff_address = models.CharField(max_length=50)
    staff_birthday = models.DateField()
    staff_InJobdate = models.DateField()
    staff_QuitJobdate = models.DateField(default=None)
    staff_Employee_type = models.CharField(max_length=10)
    staff_Base_Salary = models.FloatField(default=0)
    staff_department = models.CharField(max_length=7,default="base");

class Users(models.Model):
    user_id = models.ForeignKey(Staff, on_delete=models.CASCADE,related_name='login_id')
    password = models.CharField(max_length=30)
    usertype = models.BooleanField()

class Verify(models.Model):
    id_id = models.IntegerField(primary_key=True)
    code = models.CharField(max_length=6,default=000000)

class Sign(models.Model):
    id=models.CharField(primary_key=True,max_length=20)
    sign_id = models.IntegerField(default=None)
    sign_Date = models.CharField(max_length=50)
    sign_time_hour = models.IntegerField(default=None)
    sign_time_min = models.IntegerField(default=None)
    signout_time_hour = models.IntegerField(default=None)
    signout_time_min = models.IntegerField(default=None)
    work_time_hour = models.IntegerField(default=None)
    work_time_min = models.IntegerField(default=None)
    worktime_status = models.CharField(max_length=15)
    signout_status = models.IntegerField(default=1)

class ReportWorkingData(models.Model):
    id=models.CharField(primary_key=True,max_length=50)
    Report_Time = models.CharField(max_length=50,default=None)
    ReportWorking_id = models.IntegerField(default=None)
    ReportWorking_type = models.CharField(max_length=15)
    ReportWorking_Manname = models.CharField(max_length=30) 
    ChargeMan = models.CharField(max_length=30)
    ReportWorking_name = models.CharField(max_length=30)
    ReportWorking_WorkFinishDate = models.CharField(max_length=50)
    ReportWorking_money = models.CharField(max_length=50)
    WorkingState = models.CharField(max_length=500)
    BackUpWord = models.CharField(max_length=500)
    FinishBack = models.IntegerField(default=1)
    WordBack = models.CharField(max_length=500,default=None)

class ReportSalaryData(models.Model):
    id=models.CharField(primary_key=True,max_length=50)
    Report_Time = models.CharField(max_length=50,default=None)
    ReportSalary_id = models.IntegerField(default=None)
    ReportSalary_type = models.CharField(max_length=15)
    ReportSalary_Manname = models.CharField(max_length=30) 
    ReportSalary_name = models.CharField(max_length=30)
    ReportSalary_Date = models.CharField(max_length=50)
    ReportSalary_money = models.CharField(max_length=50)
    SalaryState = models.CharField(max_length=500)
    BackUpWord = models.CharField(max_length=500)
    FinishBack = models.IntegerField(default=1)
    WordBack = models.CharField(max_length=500,default=None)

class ReportSignData(models.Model):
    id=models.CharField(primary_key=True,max_length=50)
    ReportSign_code = models.CharField(max_length=20,default=None)
    Report_Time = models.CharField(max_length=50,default=None)
    ReportSign_id = models.IntegerField(default=None)
    ReportSign_type = models.CharField(max_length=15)
    ReportSign_Manname = models.CharField(max_length=30) 
    ReportSign_name = models.CharField(max_length=30)
    ReportSign_Date = models.CharField(max_length=50)
    Reportsign_time_hour = models.IntegerField(default=None)
    Reportsign_time_min = models.IntegerField(default=None)
    Reportsignout_time_hour = models.IntegerField(default=None)
    Reportsignout_time_min = models.IntegerField(default=None)
    SignState = models.CharField(max_length=500)
    BackUpWord = models.CharField(max_length=500)
    FinishBack = models.IntegerField(default=1)
    WordBack = models.CharField(max_length=500,default=None)


class ReportOtherData(models.Model):
    id=models.CharField(primary_key=True,max_length=50)
    Report_Time = models.CharField(max_length=50,default=None)
    ReportOther_id = models.IntegerField(default=None)
    ReportOther_Manname = models.CharField(max_length=30) 
    ReportOther_type = models.CharField(max_length=15)
    ReportOther_name = models.CharField(max_length=30)
    ReportOther_Date = models.CharField(max_length=50)
    ReportOther_money = models.CharField(max_length=50)
    OtherState = models.CharField(max_length=500)
    BackUpWord = models.CharField(max_length=500)
    FinishBack = models.IntegerField(default=1)
    WordBack = models.CharField(max_length=500,default=None)

